#ifndef __GAME_FILE_H__
#define __GAME_FILE_H__

#include "game_def.h"
#include <string>
#include <vector>

#if CGAME_TARGET_PLATFORM == CGAME_PLATFORM_MAC
typedef mode_t __mode_t;
#endif

#define C_MAX_FILENAME        128


int __mkdir(const std::string& dest);
int __mkdir(const std::string& dest,__mode_t mode);
int __mkdirs(const std::string& dest);

BOOL __is_absolute_path(const std::string& path);

BOOL __is_directory_exist(const std::string& path);
BOOL __is_file_exist(const std::string& path);

BOOL __remove_file(const std::string& path);
BOOL __copy_file(const std::string& src, const std::string& dest);
BOOL __move_file(const std::string& src, const std::string& dest);
BOOL __fsync(const std::string &path);

size_t __get_string_from_file(std::string& str,const char* filename);
BOOL __write_string_to_file(std::string& str, const std::string &filename);

std::string __get_file_extension(std::string &filename);
// 文件后缀过滤，匹配时返回真
bool __file_extension_filter(const std::string& file_path, const std::vector<std::string> &allow_list);
std::string __get_file_parent(std::string $filename);

BOOL __get_filenames_from_path(std::string path, std::vector<std::string> &filenames);

char* __getcwd(char *dest,size_t len);

#endif
